home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat3 / Tk / grab.z / grab
Text File  |  1998-10-30  |  7KB  |  133 lines

  1.  
  2.  
  3.  
  4. ggggrrrraaaabbbb((((3333TTTTkkkk))))                                                            ggggrrrraaaabbbb((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      grab - Confine pointer and keyboard events to a window sub-tree
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ggggrrrraaaabbbb ?----gggglllloooobbbbaaaallll? _w_i_n_d_o_w
  13.      ggggrrrraaaabbbb _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  14.  
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      This command implements simple pointer and keyboard grabs for Tk.  Tk's
  18.      grabs are different than the grabs described in the Xlib documentation.
  19.      When a grab is set for a particular window, Tk restricts all pointer
  20.      events to the grab window and its descendants in Tk's window hierarchy.
  21.      Whenever the pointer is within the grab window's subtree, the pointer
  22.      will behave exactly the same as if there had been no grab at all and all
  23.      events will be reported in the normal fashion.  When the pointer is
  24.      outside _w_i_n_d_o_w's tree, button presses and releases and mouse motion
  25.      events are reported to _w_i_n_d_o_w, and window entry and window exit events
  26.      are ignored.  The grab subtree ``owns'' the pointer:  windows outside the
  27.      grab subtree will be visible on the screen but they will be insensitive
  28.      until the grab is released.  The tree of windows underneath the grab
  29.      window can include top-level windows, in which case all of those top-
  30.      level windows and their descendants will continue to receive mouse events
  31.      during the grab.
  32.  
  33.      Two forms of grabs are possible:  local and global.  A local grab affects
  34.      only the grabbing application:  events will be reported to other
  35.      applications as if the grab had never occurred.  Grabs are local by
  36.      default.  A global grab locks out all applications on the screen, so that
  37.      only the given subtree of the grabbing application will be sensitive to
  38.      pointer events (mouse button presses, mouse button releases, pointer
  39.      motions, window entries, and window exits).  During global grabs the
  40.      window manager will not receive pointer events either.
  41.  
  42.      During local grabs, keyboard events (key presses and key releases) are
  43.      delivered as usual:  the window manager controls which application
  44.      receives keyboard events, and if they are sent to any window in the
  45.      grabbing application then they are redirected to the focus window.
  46.      During a global grab Tk grabs the keyboard so that all keyboard events
  47.      are always sent to the grabbing application.  The ffffooooccccuuuussss command is still
  48.      used to determine which window in the application receives the keyboard
  49.      events.  The keyboard grab is released when the grab is released.
  50.  
  51.      Grabs apply to particular displays.  If an application has windows on
  52.      multiple displays then it can establish a separate grab on each display.
  53.      The grab on a particular display affects only the windows on that
  54.      display.  It is possible for different applications on a single display
  55.      to have simultaneous local grabs, but only one application can have a
  56.      global grab on a given display at once.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ggggrrrraaaabbbb((((3333TTTTkkkk))))                                                            ggggrrrraaaabbbb((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.      The ggggrrrraaaabbbb command can take any of the following forms:
  75.  
  76.      ggggrrrraaaabbbb ?----gggglllloooobbbbaaaallll? _w_i_n_d_o_w
  77.           Same as ggggrrrraaaabbbb sssseeeetttt, described below.
  78.  
  79.      ggggrrrraaaabbbb ccccuuuurrrrrrrreeeennnntttt ?_w_i_n_d_o_w?
  80.           If _w_i_n_d_o_w is specified, returns the name of the current grab window
  81.           in this application for _w_i_n_d_o_w's display, or an empty string if
  82.           there is no such window.  If _w_i_n_d_o_w is omitted, the command returns
  83.           a list whose elements are all of the windows grabbed by this
  84.           application for all displays, or an empty string if the application
  85.           has no grabs.
  86.  
  87.      ggggrrrraaaabbbb rrrreeeelllleeeeaaaasssseeee _w_i_n_d_o_w
  88.           Releases the grab on _w_i_n_d_o_w if there is one, otherwise does nothing.
  89.           Returns an empty string.
  90.  
  91.      ggggrrrraaaabbbb sssseeeetttt ?----gggglllloooobbbbaaaallll? _w_i_n_d_o_w
  92.           Sets a grab on _w_i_n_d_o_w.  If ----gggglllloooobbbbaaaallll is specified then the grab is
  93.           global, otherwise it is local.  If a grab was already in effect for
  94.           this application on _w_i_n_d_o_w's display then it is automatically
  95.           released.  If there is already a grab on _w_i_n_d_o_w and it has the same
  96.           global/local form as the requested grab, then the command does
  97.           nothing.  Returns an empty string.
  98.  
  99.      ggggrrrraaaabbbb ssssttttaaaattttuuuussss _w_i_n_d_o_w
  100.           Returns nnnnoooonnnneeee if no grab is currently set on _w_i_n_d_o_w, llllooooccccaaaallll if a local
  101.           grab is set on _w_i_n_d_o_w, and gggglllloooobbbbaaaallll if a global grab is set.
  102.  
  103.  
  104. BBBBUUUUGGGGSSSS
  105.      It took an incredibly complex and gross implementation to produce the
  106.      simple grab effect described above.  Given the current implementation, it
  107.      isn't safe for applications to use the Xlib grab facilities at all except
  108.      through the Tk grab procedures.  If applications try to manipulate X's
  109.      grab mechanisms directly, things will probably break.
  110.  
  111.      If a single process is managing several different Tk applications, only
  112.      one of those applications can have a local grab for a given display at
  113.      any given time.  If the applications are in different processes, this
  114.      restriction doesn't exist.
  115.  
  116.  
  117. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  118.      grab, keyboard events, pointer events, window
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.